package hlhj.fhp.checkpoint.adp

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import hlhj.fhp.checkpoint.R
import hlhj.fhp.checkpoint.javaBean.ShareBean

/**
 * Created by Never Fear   on 2018\11\13 0013.
Never More....
 */
class ShareAdp(private val datas:ArrayList<ShareBean.InfoBean.ListBean.DataBean>)
    :BaseQuickAdapter<ShareBean.InfoBean.ListBean.DataBean,BaseViewHolder>(R.layout.share_list_item,datas) {
    override fun convert(helper: BaseViewHolder?, item: ShareBean.InfoBean.ListBean.DataBean?) {
        helper?.setText(R.id.itemName,item?.nickname)
        helper?.setText(R.id.itemNum,item?.phone)
        helper?.setText(R.id.itemTime,item?.created_at.toString())
        when(item?.status){
            0->{
                helper?.setText(R.id.itemStatus,"未激活")
                helper?.setTextColor(R.id.itemStatus,Color.parseColor("#FF585F65"))
            }
            1->{
                helper?.setText(R.id.itemStatus,"已激活")
                helper?.setTextColor(R.id.itemStatus,Color.parseColor("#FF6BE8A9"))
            }
        }
    }
}